<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2004" />
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2004" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="../com.ibm.style.doc/ibmdita.css" />
<link rel="stylesheet" type="text/css" href="../com.ibm.style.doc/swg_info_common.css" />
<title> ${TITLE}</title>
</head>
<body>
<h1>Marked Up Class to Service Transformation</h1>
<p>
This transformation accepts a top level UML class with a stereotype 
ClassToService::service (or the keyword, service) and generates an interface,
an implementation class and a factory class by carrying out the following mappings:
<ul>
<li>The attributes of the source class map to getter and setter methods in the interface and the implementation class.</li>
<li>The public operations of the source class map to operations in the interface.</li>
<li>The private and public operations of the source class map to operations in the implementation class.</li>
<li>The attributes of the source class map to attributes of the implementation class.</li>
<li>The factory class provides a method that creates and returns an instance of the implementation class.</li>
<li>A ClassToService::create stereotype (or the keyword, create) on an operation causes the operation to be moved to the factory class.
</ul>
A top level class is a class that is contained directly in a package or a model. An inner class which is
contained in another class is not a top level class.
</p>

<p>
If you choose a model or a package as the source, the transformation
generates output classes for each of the top level classes in the model or
the package.
</p>

<p>
This transformation uses a set of rules and sub-transforms to carry out the above mappings.
</p>

<br>

<h2>Running the Transformation</h2>

<p>
To run the transformation:
<ol>
<li>Start the run-time workbench.</li>
<li>Switch to the <b>Modeling</b> perspective.</li>
<li>
In the run-time workbench, create an UML model containing a class with a
few attributes and operations. This is your source model.
</li>

<li>In the run-time workbench, create another UML model with a package in it.
This is your target model.
</li>

<li>Apply the <b>ClassToService</b> profile to the source model.</li>
<li>Apply the stereotype <b>service</b> to one or more classes in the source model.</li>

<li>Select <b>File -&gt; New -&gt; Transformation Configuration</b> from the main menu
to create a transformation configuration file.
</li>

<li>Specify a filename in the <b>Name</b> field, select <b>Sample Transformations -&gt;
Marked up Class to Service</b> in the tree control and specify a destination
project or folder in the <b>Configuration file destination</b> field.
</li>

<li>Press the <b>Next</b> button to move to the <b>Source and Target</b> page.
Select a class, a package, or the model in the source model as the source. Select
the package in the target model or the target model itself as the target.
</li>

<li>Press the <b>Finish</b> button to create the transformation configuuration file.
</li>

<li>Right click on the transformation configuration file and select <b>Transform -&gt;
Marked up Class to Service</b>.
</li>
</ol>
 
<p>
For each class with a stereotype ClassToService::service, the transformation generates the interface,
implementation and factory classes
and places them in the specified target package. If you choose the target model
on the Target page, the transformation places the generated classes in a package
named, <b>ClassToServiceOutput</b>, in the target model.
</p>
<br>
<h2>Transformation Details</h2>
<h3>Transformation Source</h3>
<p>
This transformation accepts a UML model or a package or a class as the source.
The model should have ClassToService profile applied to it.
</p>

<h3>Transformation Target</h3>
<p>
This transformation accepts a model or a package as its target. 
</p> 
</body>
</html>
